package com.hzw.saas.service.old.hub.constants;

/**
 * @author zzl
 * @since 04/21/2021
 */
public class PathConsts {

    /**
     * 斜杠
     */
    public static final String SLASH = "/";
    /**
     * 反斜杠
     */
    public static final String BACKSLASH = "\\";
    /**
     * 正则：斜杠or反斜杠
     */
    public static final String ALL_SLASH_PATTERN = "[/\\]";

    /**
     * 格式化：重命名
     */
    public static final String COPY_SUFFIX_FORMAT = "-RENAME(%d)";
    /**
     * 正则：重命名后缀
     */
    public static final String COPY_SUFFIX_PATTERN = "^(.+)(-RENAME)\\(\\d+\\)\\s*$";

    /**
     * 正则：win下非法文件/目录名
     */
    public static final String WIN_FORBIDDEN_NAME_PATTERN = "^.*[\\\\/:*?\"<>|].*$";
    /**
     * 正则：win下合法文件/目录名
     */
    public static final String WIN_ALLOWED_NAME_PATTERN = "^[^\\\\/:*?\"<>|]+$";
    /**
     * 正则：linux下非法文件/目录名
     */
    public static final String LINUX_FORBIDDEN_NAME_PATTERN = "^.*[/].*$";
    /**
     * 正则：linux下合法文件/目录名
     */
    public static final String LINUX_ALLOWED_NAME_PATTERN = "^[^/]+$";

}
